package 算法.手动输入数据练习;

import java.util.Scanner;

/**
 * @author coderFu
 * @create 2022/3/16
 */
public class CoderStringSort3 {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            String s = sc.nextLine();
            System.out.println(sort(s));
        }
        long a = 12141483647L;
    }

    public static String sort(String s){
        if(s.length() == 1){
            return s;
        }
        String[] array = s.split(",");
        for(int i=0; i<array.length; i++){
            for(int j=i+1; j<array.length; j++){
                char a = array[i].charAt(0);
                char b = array[j].charAt(0);
                if(a > b){
                    String temp = array[i];
                    array[i] = array[j];
                    array[j] = array[i];
                }
            }
        }
        StringBuilder sb = new StringBuilder();
        for(int i=0; i<array.length; i++){
            if(i == array.length-1){
                sb.append(array[i]);
            }else{
                sb.append(array[i]).append(",");
            }
        }
        return sb.toString();
    }

}
